<template>
  <div>
    <plant-header :listData="modelValue" v-model="selectedItem"></plant-header>
    <video class="video" :src="item.resource_path" :title="item.resource_name" controls></video>
  </div>
</template>
    
<script>
import { indexPlant } from "@/util/mixin";
import ajax from "@/util/request";
export default {
  mixins: [indexPlant],
  data() {
    return {
      item: {}
    };
  },
  watch: {
    selectedItem: {
      handler() {
        ajax("/resource/queryList",{"t_cat_pk":5,"content_type":"video/mp4","rows":2}).then(({data}) => {
          if (data.status > 0 && data.result_data.length > 0) {
            this.item = data.result_data[0];
          }
        })
      }
    }
  }
};
</script>
<style scoped>
  .video {
    width: 440px;
    height: 180px;
  }
</style>